import compiler from "./compiler.js";
import { nextTick } from "./core/util.js";

// 创建 Vue3 实例, 传入一个 <script setup> 模版组件 App.vue
export const createApp = (props) => {
  // 返回一个 app 根组件, 挂载组件
  return {
    async mount(el) {
      const appStr = await props;
      await nextTick();
      const vm = document.querySelector(el);
      compiler(appStr, vm);
    },
  };
};
